package test;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Map;

import com.geek.log4jcontrol.remote.Log4jControlRemote;

public class Client {
	public static void main(String args[]) {

		Log4jControlRemote oLog4jControlRemote;
		try {
			oLog4jControlRemote = (Log4jControlRemote) Naming.lookup("rmi://127.0.0.1:8888/Log4jControl");
			Map configMap = new HashMap();
			configMap.put("logfilePath", "mock.log");
			configMap.put("rowNum", "12860");
			//configMap.put("fileSize", "1024");
			// String currentConfig =
			System.out.println(oLog4jControlRemote.getLogStr("DEFAULT", configMap));
			// oLog4jControlRemote.initConfig("DEFAULT", currentConfig);
			// ConfigHis oConfigHis = oLog4jControlRemote.getConfig("DEFAULT",
			// "LC20120803165836");
			// System.out.println(oConfigHis);
			/*List<ConfigHis> oConfigHisList = oLog4jControlRemote.getConfigList("DEFAULT");
			for (ConfigHis oConfigHis : oConfigHisList) {
				System.out.println(oConfigHis);
			}*/
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (NotBoundException e) {
			e.printStackTrace();
		}
	}
}
